package com.smedi.ismedi.progress.core.domain.service.impl;

import com.smedi.ismedi.constructionproject.api.dto.response.ProjectBasicResponse;
import com.smedi.ismedi.progress.core.domain.aggregatemodel.Progress;
import com.smedi.ismedi.progress.core.domain.repository.ProgressRepository;
import com.smedi.ismedi.progress.core.domain.service.VersionManageDomainService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务服务实体类
 *
 * @author pengyan
 * @date 2022/09/20
 */
@Service
@AllArgsConstructor
public class VersionManageDomainServiceImpl implements VersionManageDomainService {


    private final ProgressRepository progressRepository;
    @Override
    public Progress updateVersionManage(Progress versionManage) {
        return progressRepository.saveVersionManage(versionManage);
    }

    @Override
    public void selectAndUpdate(Progress versionManage, ProjectBasicResponse projectData) {
        progressRepository.selectAndUpdate(versionManage,projectData);
    }

    @Override
    public void editVersionNullify(Long version, Long projectId) {
        progressRepository.editVersionNullify(version,projectId);
    }

    @Override
    public List<Long> getVersionDownByVersionNoAndProjectId(Long version, Long projectId) {
        return progressRepository.getVersionDownByVersionNoAndProjectId(version,projectId);
    }
}
